Skip to content

refactor: enhance TTL integration tests with improved eviction and ob…#133

Merged
TKorr merged 1 commit into
mainfrom
fix/ttl-integration-test
May 14, 2026
Merged

refactor: enhance TTL integration tests with improved eviction and ob…#133
TKorr merged 1 commit into
mainfrom
fix/ttl-integration-test

Conversation

@TKorr

@TKorr TKorr commented May 14, 2026

Copy link
Copy Markdown
Contributor

…servation logic

  • Updated the RefModel struct to utilize VecDeque for managing LRU order, aligning with FastLru semantics.
  • Improved the insert method to handle key eviction more efficiently, ensuring that the model accurately reflects the cache's state.
  • Enhanced the observe_get method to promote live keys and purge expired entries, improving the accuracy of the TTL model.
  • Added a purge_dead_expired method to streamline the removal of expired deadlines, optimizing the overall eviction process.

These changes refine the integration tests for TTL functionality, ensuring better alignment with expected cache behavior and improving test reliability.

Description

Related Issue

Fixes #

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to change)
  • 📝 Documentation update
  • 🔧 Refactoring (no functional changes)
  • ⚡ Performance improvement
  • 🧪 Test addition or modification

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual testing

Test environment:

  • OS:
  • Rust version:

Checklist

  • My code follows the project's coding standards
  • I have run cargo fmt and cargo clippy
  • I have added tests for my changes
  • All new and existing tests pass (cargo test)
  • I have updated the documentation as needed
  • I have added an entry to CHANGELOG.md (if applicable)

Screenshots (if applicable)

Additional Notes

…servation logic

- Updated the `RefModel` struct to utilize `VecDeque` for managing LRU order, aligning with `FastLru` semantics.
- Improved the `insert` method to handle key eviction more efficiently, ensuring that the model accurately reflects the cache's state.
- Enhanced the `observe_get` method to promote live keys and purge expired entries, improving the accuracy of the TTL model.
- Added a `purge_dead_expired` method to streamline the removal of expired deadlines, optimizing the overall eviction process.

These changes refine the integration tests for TTL functionality, ensuring better alignment with expected cache behavior and improving test reliability.
@TKorr TKorr merged commit 0a7b5f7 into main May 14, 2026
19 checks passed
@TKorr TKorr deleted the fix/ttl-integration-test branch May 14, 2026 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant